package org.vsg.common.pagination.web.taglibs.html;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;

import org.vsg.common.pagination.Pagination;
import org.vsg.common.pagination.sort.SingleSort;
import org.vsg.common.pagination.wrapper.GenericWebPaginationWrapper;


/**
 * JSP Tag Handler class
 *
 * @jsp.tag   name = "OrderByImage"
 *            display-name = "Name for SortByImage"
 *            description = "Description for SortByImage"
 *            body-content = "empty"
 */
public class ImageSorByTag extends BaseStyleTag {
	
	public ImageSorByTag() {
		super();
		// TODO Auto-generated constructor stub
	}
	
	
	private String sortType;
	
	private String src;
	
	private String sortBy;
	
	/**
	 * @param sortType The sortType to set.
	 */
	public void setSortType(String sortType) {
		this.sortType = sortType;
	}

	/**
	 * @param src The src to set.
	 */
	public void setSrc(String src) {
		this.src = src;
	}

	/**
	 * @param orderBy The orderBy to set.
	 */
	public void setSortBy(String sortBy) {
		this.sortBy = sortBy;
	}
	
	

	public int doStartTag() throws JspException {

		HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
		// get pagination bean
		Object objref = request.getAttribute(name);
		
		GenericWebPaginationWrapper wpb = null;
		Pagination pagination = null;
		if (objref instanceof GenericWebPaginationWrapper) {
			wpb = (GenericWebPaginationWrapper)objref;
			pagination = wpb.getPagination();
		}
		
		if (pagination instanceof SingleSort) {
			SingleSort sorBy = (SingleSort)pagination;

		} else {
			throw new JspException("�����õ�\"pagination\"����֧�����򷽷�!");
		}

		
		return SKIP_BODY;
	}
		

}
